<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>青鸟搜藏</title>
<!-- 
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" type="text/css"></link>
<script type="text/javascript" src="bootstrap/js/jquery.min.js"></script>
<script	type="text/javascript" src="bootstrap/js/bootstrap.js"></script>
 -->
<script	type="text/javascript">
$(function(){   
	 $.post("weather.jsp", function(xml){
		 	var areas = xml.getElementsByTagName("city");
		 	for(var i=0;i<areas.length;i++){
		 		var weather = $(areas[i]);
		 		if(weather.attr("cityname")=="徐州市"){
		 			$("#city").text(weather.attr("cityname"));
		      $("#temp").html("最低温度"+weather.attr("tem2")+
		            		 "&nbsp;&nbsp;&nbsp;&nbsp;最高温度："+weather.attr("tem1")+
		            		 "&nbsp;&nbsp;&nbsp;&nbsp;当前温度："+weather.attr("temNow"));
		      $("#weather").text(weather.attr("stateDetailed"));
		      $("#wind").text(weather.attr("windState"));
		      $("#sd").text(weather.attr("humidity"));
		      $("#time").text(weather.attr("time"));	
		 			break;
		 		}		 		
		 	}
   },"xml");
});
</script>
</head>

<body style="padding:10px;">

	<table border="1" align="center" width="400px">
		<tr>
			<td>城市</td>
			<td id="city"></td>
		</tr>
		<tr>
			<td>天气</td>
			<td id="weather"></td>
		</tr>
		<tr>
			<td>温度</td>
			<td id="temp">
			</td>
		</tr>
		<tr>
			<td>风向</td>
			<td id="wind"></td>
		</tr>
		<tr>
			<td>湿度</td>
			<td id="sd">
			</td>
		</tr>
		<tr>
			<td>发布时间</td>
			<td id="time"></td>
		</tr>
	</table>


</body>
</html>
